import request from "@/utils/request";
export function listNewsPage(params = {}){
    return request.get(
      `/news/listNewsPage?pageNo=${params.pageNo}&pageSize=${params.pageSize}`
    );
};

//详情
export function detailsNews(id) {
  return request({
    url: `/news/findNewsById/${id}`,
    method: 'get',
  });
};

//上一篇
export function findNewsprevById(id) {
  return request({
    url: `/news/findNewsprevById/${id}`,
    method: 'get',
  });
};

//下一篇
export function findNewsnextById(id) {
  return request({
    url: `/news/findNewsnextById/${id}`,
    method: 'get',
  });
};

//修改
export function updateNews(data) {
  return request({
    url: `/news/updateNews`,
    method: 'put',
    data
  });
};
//不分页查询
export function listNews() {
  return request({
    url: `/news/listALlNews`,
    method: 'get',
  })
}
//添加
export function addNews(data) {
  return request({
    url: `/news/addNews`,
    method: 'post',
    data
  })
}
